﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.win2dEffectControl.DataClass;
using 纸片人.win2dEffectControl.DataClass.PixelShaderEffectDataClass;
using 纸片人.CalculateControls;
// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public  class BrightnessToTransparencyEffectControl : EffectControl
    {

      
        private TextBoxSlider thresholdTexBoxSlider;
        public override EffectOneSourceData OneEffetData { get; set; }

        public BrightnessToTransparencyEffectControl()
        {
            this.DefaultStyleKey = typeof(BrightnessToTransparencyEffectControl);

            OneEffetData = new BrightnessToTransparencyEffectData();
        }

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            SetEffectName("亮度转透明度效果：", "BrightnessToTransparencyEffect");

            thresholdTexBoxSlider = GetTemplateChildFormName<TextBoxSlider>(nameof(thresholdTexBoxSlider));
            SetTextBoxSlider(thresholdTexBoxSlider, OneEffetData, nameof(BrightnessToTransparencyEffectData.Threshold));
        }


    }
}